const express = require('express')
const router = express.Router()
const {checkToken} = require('../middleware/middleware')
const {cartadd,cartList,changnumber,removeOne,removechecked} = require('../controller/cart')
router.use(checkToken)

// 添加购物车接口
router.post('/api/add',cartadd)

// 获取购物车商品接口
router.get('/api/list/:id',cartList)

// 修改购物车中商品的数量接口
router.post('/api/changnumber',changnumber)

// 删除单个商品接口
router.post('/api/removeOne',removeOne)

// 删除所有被选中的商品接口
router.post('/api/removechecked',removechecked)

module.exports = router